
import DefaultCanvas from "./DefaultCanvas"
import ICanvas from "./ICanvas"
import MessageManager from "./MessageManager"
import ObjContainer from "./ObjContainer"
import WebSocketClient from "./WebSocketClient"
import RenderFrameDetails from "./canvas_hooks/default_canvas_hooks/RenderFramesDetails"
import BaseHome from "./obj/BaseHome"
import ImageObj from "./obj/ImageObj"
import PandaHeader from "./obj/PandaHeader"
import Circle from "./shapes/Circle"
import testCss from "./css/A.css"
import bCss from "./css/B.module.css"

function main() {

    let canvas: ICanvas = new DefaultCanvas("canvas");
    let hooks = (<DefaultCanvas>canvas).hooks
    hooks.addHook(new RenderFrameDetails())
    canvas.draw()//canvas启动

    let client: WebSocketClient = new WebSocketClient("ws://127.0.0.1:8081")
    client.start()//启动websocket
    MessageManager.socketClient = client
    let image = new ImageObj("/resources/images/test.jpg")
    image.onload((ev) => {
        image.width = 30
        image.height = 40
    })
    ObjContainer.addObj(image)

    ObjContainer.addObj(new BaseHome(300,300))
    // ObjContainer.addObj(new PandaHeader(600,300))
    console.log("url:",import.meta.env.VITE_testStr);
    console.log("css:",testCss);
    console.log("bcss:",bCss);
}


main()